home *** CD-ROM | disk | FTP | other *** search
- // Image Operator API for ACRViewer (Version 1.2)
- // Jens Breitenborn, 95/05/07
- //
- // A dynamically loaded Image Operator must be a subclass of the
- // ImageOperator class specified by the interface below.
- //
- // Method description:
- //
- // - (const char*) operatorName
- // Should be overwritten by a subclass
- //
- // - (BOOL)doesModify
- // A modifying Image operator makes assignments to the data argument
- // within its processImage:withWidth:height:minValue:andMaxValue:
- // method. Modifying operators can only be applied exclusively
- // to an image by ACRViewer. A subclass of ImageOperator
- // must overwrite this method, if it does not modify the image.
- // The default implementation of ImageOperator returns YES.
- //
- // - loadInterface:(const char*) filename
- // Use this method to load your interface file (.nib). filename is
- // relative to the bundle directory the subclass of ImageOperator
- // has been loaded from.
- //
- // - processImage:(unsigned short*) data
- // withWidth:(int)width height:(int) height
- // minValue:(unsigned short) minValue andMaxValue:(unsigned short) maxValue
- // Overwite this method to implement your modifying or non-modifying
- // image processing algorithm.
- // data contains an array of unsigned short typed pixels. The size of the
- // array is data[height*width]. The pixel in the upper-left corner
- // of the image is stored in data[0], the pixel in the lower-left
- // corner is stored in data[width*height-1].
- // Minimum and maximum pixel values are given by minValue/maxValue.
- // To change these values before displaying the image, use the
- // setMinValue: and setMaxValue: methods of the ImageOperator class.
- //
- // - openPanel
- // You should overwrite this method to load your interface. If the
- // interface has more than one window or panel this method should
- // bring these (if necessary for input - editing parameters) on the
- // screen. A subclass overwriting this method should
- // return [super openPanel]
- //
- // - closePanel
- // If the interface has multiple panels/windows this method should be
- // overwritten to close all panels/windows.
- // The mainPanel should be closed by returning [super closePanel]
- //
- // - apply:sender
- // This action method should be connected to the apply button in the
- // operators mainPanel
- //
- // - setMinValue:(unsigned short)minValue
- // - setMaxValue:(unsigned short)maxValue
- // Use these methods if your implementation of the image processing
- // algorithm changes these values.
- //
- // - setParameter:(const char*) parameter to:(const char*)string
- // This method is invoked by the DO API to set parameters in
- // image operators. Normally you won't have to overwrite this
- // method. The standard implementation of the ImageOperator class
- // scans the mainPanel for Form objects and sets the string value
- // in every FormCell with parameter as title to string.
- // You will only have to overwrite this method if
- // • the interface has multiple input panels/windows
- // • parameters are represented by interface objects other than Form.
- //
-
- #import <appkit/appkit.h>
-
- @interface ImageOperator:Object
- {
- @private
- id operatorController;
- BOOL interfaceLoaded;
- @protected
- id mainPanel;
- }
- - (const char*) operatorName;
- - (BOOL)doesModify;
-
- - loadInterface:(const char*) filename;
-
- - processImage:(unsigned short*) data
- withWidth:(int)width height:(int) height
- minValue:(unsigned short) minValue andMaxValue:(unsigned short) maxValue;
-
- - openPanel;
- - closePanel;
-
- - apply:sender;
-
- - setMinValue:(unsigned short)minValue;
- - setMaxValue:(unsigned short)maxValue;
-
- - setParameter:(const char*) parameter to:(const char*)string;
- @end